Introduction

In this article we analyze the territorial income distribution in the city of Barcelona using data obtained from Barcelona open data repositorie: https://opendata-ajuntament.barcelona.cat/data/en/dataset/est-renda-familiar

https://opendata-ajuntament.barcelona.cat/data/en/dataset/20170706-districtes-barris provides json files with detail of administrative units of the city of Barcelona : districts, neighbourhoods, area of interest, basic statistical areas (AEB) and census areas. Today, Barcelona contains 10 different districts and 73 neighborhoods. In this article we employ neighborhood datas.

According to https://opendata-ajuntament.barcelona.cat/ca/faqs , the coordinates in this json file use Spatial Reference System EPSG 25831, we need to transfom this system into EPSG 4326, which is the more standard reference system that we use nowadays. The simplest way to transform coordinates in Python is pyproj, i.e. the Python interface to PROJ.4 library.